﻿namespace Pp.Domain.Mappings
{
    using Model;

    public sealed class ProjectCategoryMap : EntityMap<ProjectCategory>
    {
        public ProjectCategoryMap()
        {
            Map(d => d.Description).Length(MAX_LENGTH);
            References(d => d.Parent, "ParentCategoryId").LazyLoad();
            Map(d => d.Name);
            HasMany(d => d.Projects).KeyColumn("CategoryId").LazyLoad();
        }
    }
}